#ifndef CLIB_CORE_H
#define CLIB_CORE_H

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include "clib_type.h"
#include "clib_config.h"

#define CLIB_DEV_MAX                    32

// typedef struct rte_cfgfile              cnet_cfg_conf_t;
// typedef struct rte_cfgfile_entry        cnet_conf_entry_t;
// typedef struct cnet_netif_node_s        cnet_netif_node_t;
// typedef struct cnet_netif_s             cnet_netif_t;
typedef struct clib_dpdk_dev_s          clib_dpdk_dev_t;
typedef struct clib_core_conf_s         clib_core_conf_t;
typedef struct clib_cycle_s             clib_cycle_t;
typedef struct clib_lcore_cycle_s       clib_lcore_cycle_t;
// typedef struct clib_command_s           clib_command_t;
typedef struct clib_module_s            clib_module_t;
//typedef struct clib_queue_s             clib_queue_t;
//typedef struct core_conf_s              core_conf_t;

struct clib_core_conf_s
{
    /** 线程配置 **/
    i16_t       thd[256];
    /** 日志配置 **/
    u08_t       log[CLIB_PATH_MAX];
    /** 日志类型 **/
    i32_t       log_type;
    /** 日志等级 **/
    i32_t       log_level;
    /** 栈追溯 **/
    i32_t       trace;
    /** 域socket **/
    u08_t       sock[CLIB_PATH_MAX];
    /** 监听端口 **/
    u16_t       listen;
    /** cpu配置 **/
    i16_t       cpu[256];
    /** cpu  **/
    i16_t       cpu_cnt;
    /** 线程模型 **/
    u32_t       thd_type;
    /** dpdk网卡配置**/
    clib_dpdk_dev_t dpdk_dev[CLIB_DEV_MAX];
    /** dpdk网卡数量**/
    i32_t           dpdk_dev_cnt;
    /** prefix **/
    char prefix[32];
    /** 配置文件加载 **/
    clib_config_t *conf;
};

struct clib_dpdk_dev_s 
{
    i08_t  name[16];
    i08_t  pci[16];
    i16_t  rx_queue;
    i16_t  tx_queue;
};

/** TODO初始化 **/
static clib_core_conf_t clib_core_load;

#ifdef __cplusplus
}
#endif

#endif